


#include <stdio.h>
#include "../../include/tricks.h"

int main(int argc, char *argv[])
{
    int s[5] = {1, 2, 3, 4, 5};
    int src[5] = {5, 4, 3, 2, 1};
    int *dest = (int *)malloc(sizeof(int) * 5);
    memset(dest, 0, sizeof(int) * 5);
    //int max = 5;
    int *res;
    int len = sizeof(s)/(sizeof(int));
    int i;

    res = prefix_sum(s, len);

    printf("prefix_sum is : \n");
    for (i = 0; i < len; i++)
    {
        printf(" %d |", res[i]);
    }

    if (counting_sort(src, dest, 5, 5) != -1)
    {
        printf("after counting sort \n");
        for (i = 0; i < 5; i++)
        {
            printf(" %d |", dest[i]);
        }
    }

    free(dest);
    free(res);
    return 0;
}
